home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
DRAWUSER.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
1KB
|
48 lines
/************************************************************************************/
/* DrawUserIcon */
/* */
/* This procedure draws a thick-line rounded rectangle in the userItem which */
/* has been defined in the same area of the window as the default (item #1) */
/* button. The userItem must be defined large enough to contain the thick-line */
/* rounded rectangle. */
/* */
/* This procedure gets invoked repeatedly by the Dialog Manager while the dialog */
/* is active. */
/* */
/* Note, parameter "itemNo" is the item number of the userItem, not of the default */
/* Button. "itemNo" isn't actually used in this procedure. */
/************************************************************************************/
#include "MyHeaders.h"
pascal void DrawUserIcon(DialogPtr theDialog, short itemNo)
{
GrafPtr oldPort;
PenState oldPen;
int iType;
Handle h;
CIconHandle cH;
Rect box;
GetPort(&oldPort); /* preserve current grafport */
SetPort(theDialog); /* point to dialog grafport */
GetDItem(theDialog, 4, &iType, &h, &box); /* get the icon item's info */
UseResFile (myResRefNum);
if (useColor)
{
cH = GetCIcon (128);
PlotCIcon (&box, cH);
}
else
{
h = GetResource ('ICN#', 128);
PlotIcon (&box, h);
}
SetPort(oldPort); /* restore the current grafport */
return;
}